<%@ page language="java" import="java.util.*,service.*,model.*" pageEncoding="UTF-8"%>
<%

	String viewerid = (String)request.getAttribute("viewerid");
	String ownerid = (String)request.getAttribute("ownerid");
	
	String slaveid = (String)request.getAttribute("slaveid");
	String domain = (String)request.getAttribute("domain");
	
	SaleData vdata = FriendSale.getDataObj(viewerid);
	SaleData sdata = FriendSale.getDataObj(slaveid);
	Person slave = sdata.getPerson();
//	String friendids = request.getParameter("friends");
//	String[] friends = friendids.split(",");
//	boolean self = viewerid.equals(ownerid);
//	SaleData odata = FriendSale.getDataObj(ownerid);

	Profit p = Profit.count(sdata.getPrice(),(sdata.getMaster()!=null));
%>
<div id="flag7" style="margin: 0pt auto; display: block;">
<div style="height: 370px;">

<form action="/slave/buy.php" method="post" onsubmit="javascript:return check(this);">
<input name="slaveuid" value="7189772" type="hidden">
	<div style="padding: 10px 0pt 5px 145px;">
		<div class="dealimg"><img src="<%=slave.getThumbnail() %>" width="120px" height="120px"></div>
		<div class="c"></div>
	</div>
	
	<div class="tac f14"><b>你想花 <strong class="dgreen">¥<%=sdata.getPrice() %></strong> 的价格购买<span class="sl"><%=slave.getName() %></span>为奴?</b></div>
	<div class="f14 tac"><b>你现在有现金 <strong class="dgreen">¥<%=vdata.getCash() %></strong> 。</b></div>
	<div class="c9" style="margin: 5px auto; width: 200px;">
		<div class="l" style="width: 90px;">他的上次身价</div>
		<div class="l tar" style="width: 100px;"><strong class="dgreen">¥<%=p.getOrigin()%></strong></div>
		<div class="c"></div>
		<% if(sdata.getMaster() != null){%>
		<div class="l" style="width: 90px;">原主人收益</div><div class="l tar" style="width: 100px;"><strong class="dgreen">¥<%=p.getOldmaster()%></strong></div><div class="c"></div>
		<%}%>
		<div class="l" style="width: 90px;">他的收益</div>
		<div class="l tar" style="width: 100px;"><strong class="dgreen">¥<%=p.getSlave()%></strong></div>
		<div class="c"></div>
		
		<div class="l" style="width: 90px;">人口交易印花税</div>
		<div class="l tar" style="width: 100px;"><strong class="dgreen">¥<%=p.getTax()%></strong></div>
		<div class="c" style=""></div>
		<div style="border-top: 1px solid rgb(204, 204, 204); height: 4px;"></div>
		<div class="l" style="width: 90px; margin-top: 0px ! important;">他的现在身价</div>
		<div class="l tar" style="width: 100px; margin-top: 0px ! important;"><strong class="dred">¥<%=sdata.getPrice() %></strong></div>
		<div class="c"></div>
		
	</div>
	
	<div class="f12 l mt15" style="padding-left: 110px;">给他起个绰号：</div>
	<div class="l mt15"><span class="it_s"><input id="nick" name="nick" value="" class="it1" onfocus="this.className='it2';" onblur="this.className='it1';" style="width: 10em;" maxlength="8" type="text"></span></div>
	<div class="c"></div>

<div style="padding: 10px 150px;">
	<div class="rbs1">
		<input name="submit" id="exitbutton" value="立即购买他" class="rb1-12" onmouseover="this.className='rb2-12';" onmouseout="this.className='rb1-12';" style="padding: 2px 15px;" type="button"></div>
</div>
</form>

</div>
<div style="border-top: 1px solid rgb(204, 204, 204); background: rgb(242, 242, 242) none repeat scroll 0% 0%; height: 40px; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
	<div class="r" style="width: 10px;">&nbsp;</div>
	<div class="rbs1" style="float: right;margin-top:5px">
		<input value="取消" class="rb1-12" onmouseover="this.className='rb2-12';" onmouseout="this.className='rb1-12';" style="padding: 4px 10px;" onclick="tb_remove();" type="button"></div>
	
</div>
</div>

<style>
   .rbs1{border:1px solid #d7e7fe; float:left;}
   .rb1-12,.rb2-12{height:23px; color:#fff; font-size:12px; background:#355582; padding:3px 5px; border-left:1px solid #fff; border-top:1px solid #fff; border-right:1px solid #6a6a6a; border-bottom:1px solid #6a6a6a; cursor:pointer;}
   .rb2-12{background:#355582;}
</style>